package main

import "fmt"

type Inner struct {
}

func (i Inner) SayHello() {
	fmt.Println("hello," + i.Name())
}

func (i Inner) Name() string {
	return "Inner"
}

type Outer struct {
	Inner
}

func (o Outer) Name() string {
	return "Outer"
}

func UseOuter() {
	var o Outer
	o.SayHello()
}

func main() {
	// 会打印hello,Inner,因为组合不是继承,没有重写的概念
	UseOuter()
}
